//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    menuTop: ['../resources/ic_message.png', '../resources/ic_message.png', '../resources/ic_message.png', '../resources/ic_message.png'],
    motto: 'Hello World',
    userInfo: {}
  },
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },

  tomypage: function () {

    this.setData({
      motto: "我是过晓炜"
    }),
      wx.navigateTo({
        url: '../pagesecond/pagesecond'
      })

  },

  onLoad: function () {
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })
  }
})
